#pragma once
#include "joui.h"
#include "config.h"

namespace JOUI
{
	void Jo_UICanvas_Create(LPVOID handle, INT uWidth, INT uHeight, LPVOID& dst);
	void Jo_UICanvas_Destroy(LPVOID hCanvas);
	HRESULT Jo_UICanvas_OutBloom(LPVOID hCanvas, LPVOID canvas_src, INT scRGB, POINT padding, FLOAT fblur);
	HRESULT Jo_UICanvas_OutBloomEx(LPVOID hCanvas, LPVOID canvas_src, UIimage hImg, INT shadowColor, BOOL isBloom = false, FLOAT pMaximumlight = 10.0f, FLOAT pBlur = 10.0f);
	HRESULT Jo_UICanvas_Toimg(LPVOID hCanvas, UIimage** dstImg);
	HRESULT Jo_UICanvas_blur(LPVOID hCanvas, FLOAT fDeviation, RECT* lprc = 0);
	HRESULT Jo_UICanvas_CalctextSize(LPVOID hFont, LPCWSTR lpwzText, LONG_PTR dwLen, INT dwDTFormat, FLOAT layoutWidth, FLOAT layoutHeight, FLOAT* lpWidth, FLOAT* lpHeight);
	HRESULT Jo_UICanvas_Begindraw(LPVOID hCanvas);
	HRESULT Jo_UICanvas_Enddraw(LPVOID hCanvas);
	HRESULT Jo_UICanvas_Clear(LPVOID hCanvas, INT Color);
	HRESULT Jo_UICanvas_ClipRect(LPVOID hCanvas, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom);
	HRESULT Jo_UICanvas_ResetClip(LPVOID hCanvas);
	HRESULT Jo_UICanvas_DrawImage(LPVOID hCanvas, UIimage hImage, FLOAT Left, FLOAT Top, DWORD alpha = 255);
	HRESULT Jo_UICanvas_DrawImageRect(LPVOID hCanvas, UIimage hImage, FLOAT Left, FLOAT Top, FLOAT Right, FLOAT Bottom,INT mode, DWORD alpha, INT radius);
	HRESULT Jo_UICanvas_DrawImageRectRect(LPVOID hCanvas, UIimage hImage, FLOAT dstLeft, FLOAT dstTop, FLOAT dstRight, FLOAT dstBottom,
		FLOAT srcLeft, FLOAT srcTop, FLOAT srcRight, FLOAT srcBottom, INT mode, DWORD alpha, INT radius);
	HRESULT Jo_UICanvas_DrawImageFromGrid(LPVOID hCanvas, UIimage hImage, FLOAT dstLeft, FLOAT dstTop, FLOAT dstRight, FLOAT dstBottom,
		FLOAT srcLeft, FLOAT srcTop, FLOAT srcRight, FLOAT srcBottom, FLOAT gridPaddingLeft, FLOAT gridPaddingTop, FLOAT gridPaddingRight,
		FLOAT gridPaddingBottom, INT dwFlags, DWORD dwAlpha);
	HRESULT Jo_UICanvas_DrawLine(LPVOID hCanvas, UIbrush hBrush, FLOAT X1, FLOAT Y1, FLOAT X2, FLOAT Y2, FLOAT strokeWidth, DWORD strokeStyle, BOOL isRadius);
	HRESULT Jo_UICanvas_DrawPoint(LPVOID hCanvas, UIbrush hBrush, FLOAT x, FLOAT y, FLOAT strokeWidth, BOOL isRadius = false);
	HRESULT Jo_UICanvas_DrawPoly(LPVOID hCanvas, UIbrush hBrush, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom, UINT NumberOfEdges, FLOAT Angle,
		FLOAT strokeWidth, UINT strokeStyle);

	HRESULT Jo_UICanvas_FillPoly(LPVOID hCanvas, UIbrush hBrush, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom, UINT NumberOfEdges, FLOAT Angle);
	HRESULT Jo_UICanvas_DrawPath(LPVOID hCanvas, LPVOID hPath, UIbrush hBrush, FLOAT strokeWidth, DWORD strokeStyle);
	HRESULT Jo_UICanvas_FillPath(LPVOID hCanvas, LPVOID hPath, UIbrush hBrush);
	HRESULT Jo_UICanvas_DrawRect(LPVOID hCanvas, UIbrush hBrush, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom, FLOAT strokeWidth, DWORD strokeStyle);
	HRESULT Jo_UICanvas_FillRect(LPVOID hCanvas, UIbrush hBrush, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom);
	HRESULT Jo_UICanvas_DrawRoundedrect(LPVOID hCanvas, UIbrush hBrush, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom, FLOAT radius, FLOAT strokeWidth, DWORD strokeStyle);
	HRESULT Jo_UICanvas_FillRoundedrect(LPVOID hCanvas, UIbrush hBrush, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom, FLOAT radius);
	HRESULT Jo_UICanvas_DrawText(LPVOID hCanvas, LPCWSTR lpwzText, LPVOID hFont, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom, INT crText, INT dwDTFormat);
	HRESULT Jo_UICanvas_DrawelIipse(LPVOID hCanvas, UIbrush hBrush, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom, FLOAT strokeWidth, DWORD strokeStyle);
	HRESULT Jo_UICanvas_Fillellipse(LPVOID hCanvas, UIbrush hBrush, FLOAT left, FLOAT top, FLOAT right, FLOAT bottom);
	HRESULT Jo_UICanvas_FillRegion(LPVOID hCanvas, LPVOID hRgn, UIbrush hBrush);
	HRESULT Jo_UICanvas_Flush(LPVOID hCanvas);
	HDC Jo_UICanvas_GetDc(LPVOID hCanvas);
	HRESULT Jo_UICanvas_ReleaseDc(LPVOID hCanvas);
	HRESULT Jo_UICanvas_GetSize(LPVOID hCanvas, INT& width, INT& height);
	HRESULT Jo_UICanvas_Resize(LPVOID hCanvas, INT width, INT height);
	void Jo_UICanvas_Rotate(LPVOID hCanvas, FLOAT fAngle, FLOAT scaleX, FLOAT scaleY);
	HRESULT Jo_UICanvas_SetTransform(LPVOID hCanvas, LPVOID matrix);


}